﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Maui.App.Services;

namespace Maui.App.ViewModels
{
    public partial class TabMViewModel : BaseViewModel
    {
        INavigationService _navigationService;
        public TabMViewModel(INavigationService navigationService)
        {
            _navigationService = navigationService;

            Timer timer = new Timer(obj =>
            {
                Shell.Current.Dispatcher.Dispatch(new Action(() => { CurTime = $"{DateTime.Now:HH:mm:ss,fff}"; }));
                

                
            }, null, -1, -1);

            timer.Change(5000, 1000);
        }
        [ObservableProperty]
        private string curTime;
        [RelayCommand]
        async Task GoTo()
        {
           await _navigationService.NavigateToAsync(nameof(Reg));
        }
    }
}
